package com.qingjiang.projectschedule.utils;

import com.qingjiang.projectschedule.pojo.ProjectSchedule;
import com.qingjiang.projectschedule.pojo.vo.ProjectScheduleVO;

import java.util.ArrayList;
import java.util.List;

public class Convert_ProjectScheduleVO {

    public static List<ProjectScheduleVO> convertProjectScheduleVOList(List<ProjectSchedule> projectScheduleList) {
        List<ProjectScheduleVO> projectScheduleVOList = new ArrayList<>();
        for (ProjectSchedule projectSchedule : projectScheduleList) {
            ProjectScheduleVO projectScheduleVO = new ProjectScheduleVO();
            projectScheduleVO.setProjectId(projectSchedule.getProjectId());
            projectScheduleVO.setNodeId(projectSchedule.getNodeId());
            projectScheduleVO.setNodeState(projectSchedule.getNodeState());
            projectScheduleVO.setScheduleStartTime(DateUtil.DateConvert(projectSchedule.getScheduleStartTime()));
            projectScheduleVO.setScheduleEndTime(DateUtil.DateConvert(projectSchedule.getScheduleEndTime()));
            projectScheduleVO.setDelayTotime(DateUtil.DateConvert(projectSchedule.getDelayTotime()));
            projectScheduleVO.setActualStartTime(DateUtil.DateConvert(projectSchedule.getActualStartTime()));
            projectScheduleVO.setActualEndTime(DateUtil.DateConvert(projectSchedule.getActualEndTime()));
            projectScheduleVO.setDelayReason(projectSchedule.getDelayReason());
            projectScheduleVOList.add(projectScheduleVO);
        }
        return projectScheduleVOList;
    }


}
